#ifndef __LLD_TUN_MXL603_TDS_H__
#define __LLD_TUN_MXL603_TDS_H__

#include <sys_config.h>
#include <retcode.h>
#include <types.h>
#include <osal/osal.h>
#include <api/libc/alloc.h>
#include <api/libc/printf.h>
#include <api/libc/string.h>
#include <hal/hal_gpio.h>
#include <hld/hld_dev.h>
#include <hld/nim/nim_dev.h>
#include <hld/nim/nim.h>
#include <hld/nim/nim_tuner.h>
#include <bus/i2c/i2c.h>
#include <hld/dmx/dmx_dev.h>
#include <hld/dmx/dmx.h>

#include <api/libdiseqc/lib_diseqc.h>
#include <api/libsi/si_tdt.h>


#include "MaxLinearDataTypes.h"

#ifdef __cplusplus
extern "C"
{
#endif







#define nim_print  		libc_printf



#define comm_malloc 			MALLOC
#define comm_memset				MEMSET
#define comm_free				FREE
#define comm_delay				nim_comm_delay
#define comm_sleep				osal_task_sleep
#define comm_memcpy				memcpy

#define nim_i2c_read			i2c_read
#define nim_i2c_write			i2c_write
#define nim_i2c_write_read		i2c_write_read


#define osal_mutex_create			OS_CreateMutex
#define osal_mutex_delete			OS_DeleteMutex
#define osal_mutex_lock				OS_LockMutex
#define osal_mutex_unlock			OS_UnlockMutex



void 		nim_comm_delay(UINT32 us);



/******************************************************************************
    Global Variable Declarations
******************************************************************************/
extern void * MxL603_OEM_DataPtr[];
/*****************************************************************************
    Prototypes
******************************************************************************/

INT32 tun_mxl603_init_DVBC(UINT32 *tuner_id , struct QAM_TUNER_CONFIG_EXT * ptrTuner_Config);
INT32 tun_mxl603_control_DVBC(UINT32 tuner_id, UINT32 freq, UINT32 sym, UINT8 AGC_Time_Const, UINT8 _i2c_cmd);
INT32 tun_mxl603_status(UINT32 tuner_id, UINT8 *lock);


INT32 tun_mxl603_init(UINT32 *tuner_id, struct COFDM_TUNER_CONFIG_EXT * ptrTuner_Config);
INT32 tun_mxl603_init_ISDBT(UINT32 *tuner_id, struct COFDM_TUNER_CONFIG_EXT * ptrTuner_Config)  ;
INT32 tun_mxl603_init_ISDBT(UINT32 *tuner_id, struct COFDM_TUNER_CONFIG_EXT * ptrTuner_Config)  ;
INT32 tun_mxl603_init_CDT_MN88472(UINT32 *tuner_id, struct COFDM_TUNER_CONFIG_EXT * ptrTuner_Config) ;
INT32 tun_mxl603_control(UINT32 tuner_id, UINT32 freq, UINT8 bandwidth,UINT8 AGC_Time_Const,UINT8 *data,UINT8 _i2c_cmd)	;


MXL_STATUS MxLWare603_OEM_WriteRegister(UINT32 tuner_id, UINT8 regAddr, UINT8 regData);
MXL_STATUS MxLWare603_OEM_ReadRegister(UINT32 tuner_id, UINT8 regAddr, UINT8 *regDataPtr);
void MxLWare603_OEM_Sleep(UINT16 delayTimeInMs);  



#ifdef __cplusplus
}
#endif

#endif  /* __LLD_TUN_TDA18250_H__ */


